unit CadCarreta;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Template, AppEvnts, DB, Buttons, ComCtrls, ToolWin, StdCtrls,
  Mask, DBCtrls, JvExControls, JvComponent, JvDBLookup, JvExMask,
  JvToolEdit, JvDBControls, Menus;

type
  TFormCadCarreta = class(TFormTemplate)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label8: TLabel;
    Label15: TLabel;
    SpeedButton6: TSpeedButton;
    Label17: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit6: TDBEdit;
    DBEdit8: TDBEdit;
    DBCheckBoxDeletado: TDBCheckBox;
    DBEdit15: TDBEdit;
    JvDBLookupComboProprietario: TJvDBLookupCombo;
    DBEdit17: TDBEdit;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    SpeedButton5: TSpeedButton;
    Label16: TLabel;
    SpeedButton7: TSpeedButton;
    DBEdit9: TDBEdit;
    DBEdit10: TDBEdit;
    DBEdit11: TDBEdit;
    DBEdit12: TDBEdit;
    JvDBLookupComboMarca: TJvDBLookupCombo;
    JvDBLookupComboTipoVeiculo: TJvDBLookupCombo;
    JvDBLookupComboModelo: TJvDBLookupCombo;
    JvDBLookupComboCor: TJvDBLookupCombo;
    DBEdit16: TDBEdit;
    JvDBLookupComboCidade: TJvDBLookupCombo;
    Label18: TLabel;
    SpeedButton8: TSpeedButton;
    Label19: TLabel;
    JvDBLookupComboUsuarioWeb: TJvDBLookupCombo;
    DBEdit18: TDBEdit;
    SpeedButton9: TSpeedButton;
    Label21: TLabel;
    SpeedButton10: TSpeedButton;
    DBEditRastreador: TDBEdit;
    JvDBLookupComboRastreador: TJvDBLookupCombo;
    DBEditData: TJvDBDateEdit;
    Label22: TLabel;
    procedure btnAbrirClick(Sender: TObject);
    procedure btnPesquisarClick(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure SpeedButton5Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure SpeedButton6Click(Sender: TObject);
    procedure SpeedButton7Click(Sender: TObject);
    procedure SpeedButton9Click(Sender: TObject);
    procedure SpeedButton10Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormCadCarreta: TFormCadCarreta;

implementation

uses DM, DMS, Abrir, Pesquisa, Principal, Geral;

{$R *.dfm}

procedure TFormCadCarreta.btnAbrirClick(Sender: TObject);
begin
  inherited;
    FormAbrir.Mostrar(DMprinc.QueryCarreta,'CODVEICULO');
    FreeAndNil(FormAbrir);
end;

procedure TFormCadCarreta.btnPesquisarClick(Sender: TObject);
begin
  inherited;
    FormPesquisa.Mostrar('Pesquisa por placa' , 'codveiculo' , Dmprinc.QueryCarreta ,
                        'Chassi;CHASSI;Renavam;RENAVAM;Placa;placa;');
    FreeAndNil(FormPesquisa);
end;

procedure TFormCadCarreta.SpeedButton1Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Marca1 , JvDBLookupComboMarca );
end;

procedure TFormCadCarreta.SpeedButton3Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.ipodeveculo1 , JvDBLookupComboTipoVeiculo);
end;

procedure TFormCadCarreta.SpeedButton4Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Modelo1  , JvDBLookupComboModelo );
end;

procedure TFormCadCarreta.SpeedButton5Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Cor1 , JvDBLookupComboCor );
end;

procedure TFormCadCarreta.FormShow(Sender: TObject);
begin
  inherited;
    SetaDataset(dsPrincipal , DMprinc.QueryCarreta );
    PageControl1.ActivePage := TabSheet1;
end;

procedure TFormCadCarreta.SpeedButton6Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Cliente1 , JvDBLookupComboProprietario);
end;

procedure TFormCadCarreta.SpeedButton7Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Cidade1 , JvDBLookupComboCidade );
end;

procedure TFormCadCarreta.SpeedButton9Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.UsurioWeb1,JvDBLookupComboUsuarioWeb);
end;

procedure TFormCadCarreta.SpeedButton10Click(Sender: TObject);
begin
  inherited;
    CadastroNewCombo(FormPrincipal.Rastreador1 , JvDBLookupComboRastreador );
end;

end.
